<template>
  <div v-if="showFlag" class="mainForm" style="width: 90%;margin: auto">
    <div style="line-height: 50px; font-size: 30px; color: dodgerblue; margin-top: 20px; width: 100%;">优质中小企业梯度培育诊断报表
      <el-button style="float: right;margin-top: 5px" type="warning" size="normal" @click="onCancel">返回</el-button>
    </div>
    <div style="background: #eeeeee;padding: 20px;margin-top: 30px">
      <div style="width: 95%;margin: auto;background: #ffffff;padding: 20px;">
        <el-form
          ref="base"
          :model="base"
          label-width="205px"
        >
          <div class="title2">企业信息<el-button id="closeSearchBtn0" type="text" style="margin-left:10px;float: right" @click="closeSearch0(1)">
            {{ word0 }}
            <i :class="showAll0 ? 'el-icon-arrow-up ': 'el-icon-arrow-down'" />
          </el-button></div>
          <div v-if="showAll0 == true">
            <el-form-item label="企业名称" prop="entName">
              <div class="acaca">{{ base.entName }}</div>
            </el-form-item>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="统一社会信用代码" prop="entCode">
                  <div class="acaca">{{ base.entCode }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item class="el220" label="法人代表" prop="legalPerson">
                  <div class="acaca">{{ base.legalPerson }}</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="企业注册地" prop="areaSelect1">
              <div class="acaca">{{ base.provName }}》{{ base.cityName }}》{{ base.distName }}</div>
            </el-form-item>
            <el-form-item label="注册地址" prop="regAddress">
              <div class="acaca">{{ base.regAddress }}</div>
            </el-form-item>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="注册时间" prop="regTime">
                  <div class="acaca">{{ base.regTime }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item class="el220" label="注册资本(万元)" prop="regCapital">
                  <div class="acaca">{{ base.regCapital }}万元</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="所属行业" prop="industry1">
              <div class="acaca">{{ base.industryName }}》{{ base.industrySecondName }}</div>
            </el-form-item>
            <el-form-item label="具体细分领域" prop="industry">
              <div class="acaca">{{ base.industryName }}》
                {{ base.industrySecondName }}》
                {{ base.industryThreeName }}》
                {{ base.industryFourthName }}</div>
            </el-form-item>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="企业类型" prop="entType">
                  <div class="acaca">{{ base.entTypeName }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item class="el220" label="企业规模" prop="entScale">
                  <div class="acaca">{{ base.entScaleName }}</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="生产经营年限" prop="operationLife">
                  <div class="acaca">{{ base.operationLife }}年</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item class="el220" label="全职员工数量" prop="entNumber">
                  <div class="acaca">{{ base.entNumber }}人</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item class="xjr" label="与现有“小巨人”企业存在控股关系" prop="entHolding">
              <div v-if="base.entHolding === '1'" class="acaca">是</div>
              <div v-if="base.entHolding === '0'" class="acaca">否</div>
            </el-form-item>
            <el-form-item class="xjr" label="同集团内有其他生产相似主导产品企业获得认定或申报" prop="entSimilar">
              <div v-if="base.entSimilar === '1'" class="acaca">是</div>
              <div v-if="base.entSimilar === '0'" class="acaca">否</div>
            </el-form-item>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="联系人姓名" prop="contactsName">
                  <div class="acaca">{{ base.contactsName }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item class="el220" label="联系人电话" prop="contactsTel">
                  <div class="acaca">{{ base.contactsTel }}</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="联系人手机" prop="contactsMobile">
                  <div class="acaca">{{ base.contactsMobile }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item class="el220" label="电子邮箱" prop="email">
                  <div class="acaca">{{ base.email }}</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item class="el220" label="邮编" prop="postalCode">
                  <div class="acaca">{{ base.postalCode }}</div>
                </el-form-item>
              </el-col>
              <el-col :span="12" />
            </el-row>
            <el-form-item label="通讯地址" prop="commAddress">
              <div class="acaca">{{ base.commAddress }}</div>
            </el-form-item>
            <el-form-item label="经营范围" prop="businessScope">
              <div class="acaca">{{ base.businessScope }}</div>
            </el-form-item>

          </div>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import { find } from '@/api/enterprise'
export default {
  name: 'EnterpriseDetails',
  data() {
    return {
      base: {},
      word0: '收起',
      showAll0: true,
      showFlag: false
    }
  },
  created() {
    this.getDate(this.$route.query)
  },
  methods: {
    getDate(data) {
      find(data).then(response => {
        console.log(response)
        if (response.result === 0) {
          this.$message({
            message: response.msg, type: 'error'
          })
        }
        if (response.result === 1) {
          this.base = response.data
        }
        this.showFlag = true
      })
    },
    closeSearch0(i) {
      if (this.showAll0 === false) {
        this.showAll0 = true
        this.word0 = '收起'
      } else {
        this.showAll0 = false
        this.word0 = '展开'
      }
    },
    onCancel() {
      this.$parent.$parent.$children[2].closeSelectedTag({ path: this.$route.path, name: this.$route.name, fullPath: this.$route.fullPath, meta: this.$route.meta })
    }
  }
}
</script>
<style scoped>
.title2 {
  line-height: 40px;
  font-size: 20px;
  color: darkgray;
  border-bottom: 1px #cccccc solid;
  margin-bottom: 20px;
}
</style>
<style>
.mainForm .el-form-item__label{
  /*width: 140px !important;*/
  text-align: left !important;
  background: #409eff;
  color: #ffffff;
  padding-left: 10px;
}
.mainForm .el260 .el-input{
  width: 260px !important;
}
.mainForm .el260 .el-form-item__label{
  margin-right: 5px !important;
}
.mainForm .el220 .el-input{
  width: 220px !important;
}
.xjr .el-form-item__label{
  width: 400px!important;
  text-align: left !important;
  background: #409eff;
  color: #ffffff;
  padding-left: 10px;
  margin-right: 30px;
}
.mainForm .steps .el-step.is-simple:not(:last-of-type) .el-step__title {
  max-width: 85%;
  word-break: break-all;
}
.acaca{
  margin-left: 15px;
  border-bottom: #409eff 1px solid;
}
</style>
